
/* 
* This file is part of Equaked.
*
* Equaked is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* any later version.
*
* Equaked is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Foobar; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
*/
#ifndef _LOGGER_H_
#define _LOGGER_H_

#include <ostream>
#include <fstream>
#include <string>

#include "common.h"

namespace equaked {

typedef std::string String;

class Logger {
	public:
		Logger(const String& file = "", bool enable = true); 
		~Logger();

		void info(const char *  message); 

		bool isEnable(); 
		void setEnable(bool enable);

		std::ostream * getOs();
		void flush();

		friend Logger& operator<<(Logger&, const String&); 
		friend Logger& operator<<(Logger&, const char*);
		friend Logger& operator<<(Logger&, int);
		 

	private:
		bool _enable;
		std::ostream * _os; 
};



};

#endif //_LOGGER_H_
